<%--
  Created by IntelliJ IDEA.
  User: cgl
  Date: 2021/6/7
  Time: 10:49
  To change this template use File | Settings | File Templates.
--%>
<%@page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <base href="<%=basePath%>">

    <title>My JSP 'MyJsp.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <link rel="stylesheet" type="text/css" href="css/css1/orderInfo.css"/>
    <!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
    <link rel="stylesheet" type="text/css" href="css/css1/ticket.css"/>
</head>
<script type="text/javascript">
    function yuDing(){
       /* alert("lllll")
        var weizhi=document.getElementsByName("weizhi")
        var ck4= $("#ck4").val();
        var price=document.getElementsByName("price")*/
        var weizhi='A'
        var price= ${trainNumber.price}
        var ck4=1
        alert("出票成功")
            alert("位置："+weizhi+"类型："+ck4+"价格："+price)
        $.getJSON("train/chupiao", {
            weizhi: weizhi,
            ck4: ck4,
            price: price
        }, function (ticket) {
            alert(ticket)
        });
    }
    function pay(){
        /*创建订单*/

    }
    function tjck() {
        var x= $("#ck1").html();
        $("#tjcktd").html(x);
    }
    function addChengKe() {
        location="toaddpersion";
    }

</script>
<body>
<div class="bg">
    <br />
    <!--标题栏-->
    <div class="head-frame">
        <div class="head-panel">
            <img src="img/logo1.png" />
            <div class="search">
                <input class="search-field" type="text" />
                <img src="img/icon_search.png" />
            </div>
            <div class="ctrl">
                <div class="my12306">我的12306</div>
                <div class="line"></div>
                <div id="welcome" class="font">欢迎</div>
                <div class="font" onclick="userExit()">注销</div>
            </div>
        </div>
    </div>
    <br />
    <!--菜单栏-->
    <div class="menu-frame">
        <div class="menu-panel">
            <div class="menuValue"onclick="window.location.href ='toticket'">首页</div>
            <div class="menuValue">车票预定</div>
            <div class="menuValue"onclick="window.location.href ='orderInfo.jsp'">订单信息</div>
            <div class="menuValue"onclick="window.location.href ='userInfo.jsp'">我的信息</div>
            <div class="menuValue">车站服务</div>
            <div class="menuValue">商旅服务</div>
            <div class="menuValue">出行指南</div>
        </div>
    </div>
    <br />
    <!--输入栏-->
    <div class="input-frame" >
        <div class="input-panel">
            <div class="ctrl">
                <div id="Departuredate">
                    出发时间:${trainNumber.departureDate}
                </div>
                <div class="line"></div>
                <div class="start">
                    <span id="123">${siteStart}</span>
                    <span id="">
                  	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;----------------》
                  </span>
                </div>

                <div class="arrive-time">
                    <span>${siteEnd}</span>

                </div>
                <div class="line"></div>

                <div class="btn">

                </div>
            </div>
        </div>
    </div>
    <!--车票主界面-->

    <table class="data-table"  cellspacing="0" cellpadding="0" width="70%" style="margin: 50px auto">
        <thead>

        <tr class="data-col" height="30px" >
            <td class="data-td">起始站： ${siteStart}

                <br class="data-td"/>出发时间:&nbsp;  ${trainNumber.departureTime}</td>
            <td class="data-td">车名:${trainNumber.train.trainType.typeName}${trainNumber.train.trainName}
                <br class="data-td"/>乘坐时间 &nbsp;1:20</td>
            </td>
            <td class="data-td">终点站:${siteEnd}
                <br class="data-td"/>到达时间:${trainNumber.destinationTime}

            </td>
        </tr>

        <tr class="data-col" height="30px" >
            <td class="data-td">乘坐人<br><br>

                <button onclick="addChengKe()" style="width: 100px; ">添加乘客</button>
            </td>
            <td class="data-td" id="ck1">
                乘客1<br><br>
                <select  style="width: 150px;"><br class="data-td" id="ck4"/>
                    <c:forEach items="${plist}" var="p">
                           <option value ="${p.passengerId}">${p.passengerName}</option>
                    </c:forEach>
                </select>
                <input type="radio" name="weizhi" checked="checked" value="A">A
                 <input type="radio" name="weizhi" checked="checked" value="B">B
                 <input type="radio" name="weizhi" checked="checked" value="C"> C
                <br class="data-td" /><div id="weizhi"></div>
            </td>

            <td id="tjcktd" class="data-td">
                <button  onclick="tjck()">添加乘客</button>
            </td>

        </tr>

        </thead>
        <tbody id="dataBody">
        <tr align="center">
            <form action="Pay" METHOD="post">
            <td class="data-td">
                <input type="radio" name="price" checked="checked" value="100">商务：无 <span id="jg1">100</span>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="price" checked="checked" value="50">一等:无<span id="jg2">50</span>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="price"id="price" checked="checked" value="${trainNumber.price}">二等:${trainNumber.price}:${trainNumber.yesNo}
            </td>
            <td class="data-td">
                <input type="hidden" name="departureDate" value="${trainNumber.departureDate}">
                <input type="hidden" name="departureTime" value="${trainNumber.departureTime}">
                <input type="hidden" name="startingStation.city" value="${siteStart}">
                <input type="hidden" name="terminalStation.city" value="${siteEnd}">
                <input type="submit" class="buyBtn"id="buyBtn"  value="提交">
                <%--<button    class="buyBtn" onclick="pay()">支付</button>--%>
            </td>
            <td class="data-td">
                <br class="data-td"/>
            </td>
            <td class="data-td">
            </td>
            </form>
        </tr>
        <tr align="center">
            <td class="data-td">
                <input type="button" class="buyBtn"id="buyBtn1"  value="预定"onclick="yuDing()">预定
            </td>

        </tr>

        </tbody>
    </table>

    <br /><br /><br /><br />
    <div class="other">
        <div class="o1">版权所有O2008-2018中国铁路信息科技有限责任公司中国铁道科学研究院集团有限公司</div>
        <div>京CP备15003716号-3[CP证150437号</div>
    </div>
</div>
<script src="js/js1/jquery-3.6.0.min.js"></script>

</body>
</html>

